Avoid a hang when probing the partition table on imported block
authorsos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>
Fri, 2 Dec 2005 14:16:37 +0000 (15:16 +0100)
committersos22@douglas.cl.cam.ac.uk <sos22@douglas.cl.cam.ac.uk>
Fri, 2 Dec 2005 14:16:37 +0000 (15:16 +0100)
commitc10797216b26af4328de6761275dfa8fd21736ff
tree5a4d8f01fb4592963ce15505d872990c488eb47e
parent8afc538db6ced34346ea363204241d8e4dd16584
Avoid a hang when probing the partition table on imported block
devices.  If you export a device so the importing domain sees it as a
whole disk rather than a partition, then add_disk will try to probe
its partition table.  However, we were calling add_disk before the
device was properly connected, and then not connecting it until
add_disk had finished.  This meant that we ended up never actually
connecting the device, and any accesses to it would then hang.

Fix this by not calling add_disk until we're connected.

Signed-off-by: Steven Smith, sos22@cam.ac.uk
linux-2.6-xen-sparse/drivers/xen/blkfront/blkfront.c
linux-2.6-xen-sparse/drivers/xen/blkfront/block.h
linux-2.6-xen-sparse/drivers/xen/blkfront/vbd.c